package com.qinyeit.serviceapp.security.token;

import com.qinyetech.springstage.core.security.StatelessSecurityToken;
import com.qinyetech.springstage.core.security.TerminalDevice;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;


@Data
public class RestaurantChainAuthenticationToken extends StatelessSecurityToken {
    public static final String ADMIN_PARAM_NAME="adminAccount";

    private String adminAccount;

    public RestaurantChainAuthenticationToken(String username, String password,
                                              boolean rememberMe, String host,
                                              TerminalDevice terminalDevice, String adminAccount) {
        super(username, password, rememberMe, host, terminalDevice);
        this.adminAccount = adminAccount;
    }

    public RestaurantChainAuthenticationToken(String username, String password, boolean rememberMe, String host, TerminalDevice terminalDevice) {
        super(username, password, rememberMe, host, terminalDevice);
    }
    public boolean isAdmin(){
        return StringUtils.isBlank(adminAccount);
    }
}
